package com.tedu.cooshark.service;

import com.tedu.cooshark.dao.BannerMapper;
import com.tedu.cooshark.entity.Banner;
import com.tedu.cooshark.entity.Category;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 2022/3/24  14:46
 */
@Service
public class BannerService {
    @Autowired
    private BannerMapper bannerMapper;
   public List<Banner> seletAll(){
       return bannerMapper.seletAll();
   }
   public int inser(Banner banner){
       return bannerMapper.insert(banner);
   }
   public int deleteById(Banner banner){
       return bannerMapper.deleteById(banner);
   }
    public int deleteBannerByids(List<Banner> banners){
        int n=0;
        for (Banner banner : banners) {
            bannerMapper.deleteById(banner);
            n++;
        }
        return n;
    }
   public int updateBanne(Banner banner){
       return bannerMapper.updateBanne(banner);
   }
}
